
import { ajax } from './util.js'
var basUrl = "https://douban.uieee.com"
// var basUrl = "https://api.douban.com"
// var basUrl = "http://t.yushu.im"

function requireTop(data){ //top50
  var url = basUrl +'/v2/movie/top250'
  return ajax({url,data})
}

function nowHotsMovie(data){ //正在热映
  var url= basUrl+'/v2/movie/in_theaters'
  return ajax({ url, data })
}

function fouMovie(data){ //即将上映
  var url = basUrl +'/v2/movie/coming_soon'
  return ajax({ url, data })
}

function movieDetail(id) { //电影详情
  var url = basUrl + '/v2/movie/subject/'+id
  return ajax({ url })
}
function movieSearch(data){
  var url = basUrl + '/v2/movie/search'
  return ajax({url, data})
}

export {
  requireTop,
  nowHotsMovie,
  fouMovie,
  movieDetail,
  movieSearch
}